package com.ruoyi.job.service.impl;

import java.util.List;

import com.ruoyi.common.datasource.annotation.Master;
import com.ruoyi.common.datasource.annotation.Slave;
import com.ruoyi.job.domain.SysJob;
import com.ruoyi.job.mapper.SysJobMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.job.mapper.EtlTaskPreschedMapper;
import com.ruoyi.job.domain.EtlTaskPresched;
import com.ruoyi.job.service.IEtlTaskPreschedService;

/**
 * 任务前置表Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-07-31
 */
@Service
public class EtlTaskPreschedServiceImpl implements IEtlTaskPreschedService
{
    @Autowired
    private EtlTaskPreschedMapper etlTaskPreschedMapper;

    @Autowired
    private SysJobMapper sysJobMapper;

    /**
     * 查询任务前置表
     * 
     * @param taskId 任务前置表ID
     * @return 任务前置表
     */
    @Override
    public EtlTaskPresched selectEtlTaskPreschedById(String taskId)
    {
        return etlTaskPreschedMapper.selectEtlTaskPreschedById(taskId);
    }

    /**
     * 查询任务前置表列表
     * 
     * @param etlTaskPresched 任务前置表
     * @return 任务前置表
     */
    @Override
    public List<EtlTaskPresched> selectEtlTaskPreschedList(EtlTaskPresched etlTaskPresched)
    {
        List<EtlTaskPresched> doList = etlTaskPreschedMapper.getPreTaskSched(etlTaskPresched);
        return doList;
    }

    /**
     * 新增任务前置表
     * 
     * @param etlTaskPresched 任务前置表
     * @return 结果
     */
    @Override
    public int insertEtlTaskPresched(EtlTaskPresched etlTaskPresched)
    {
        return etlTaskPreschedMapper.insertEtlTaskPresched(etlTaskPresched);
    }

    /**
     * 修改任务前置表
     * 
     * @param etlTaskPresched 任务前置表
     * @return 结果
     */
    @Override
    public int updateEtlTaskPresched(EtlTaskPresched etlTaskPresched)
    {
        return etlTaskPreschedMapper.updateEtlTaskPresched(etlTaskPresched);
    }

    /**
     * 批量删除任务前置表
     * 
     * @param taskIds 需要删除的任务前置表ID
     * @return 结果
     */
    @Override
    public int deleteEtlTaskPreschedByIds(String[] taskIds)
    {
        return etlTaskPreschedMapper.deleteEtlTaskPreschedByIds(taskIds);
    }

    /**
     * 删除任务前置表信息
     * 
     * @param taskId 任务前置表ID
     * @return 结果
     */
    @Override
    public int deleteEtlTaskPreschedById(String taskId)
    {
        return etlTaskPreschedMapper.deleteEtlTaskPreschedById(taskId);
    }
}
